// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use core::ops::Range;

// NOTE: This DER blob, offsets & lengths are generated code. This
// is currently accomplished by an external tool:
// https://github.com/oxidecomputer/dice-util
// TODO: Generate cert templates in-tree.

pub const SIZE: usize = 432;
pub const SERIAL_NUMBER_RANGE: Range<usize> = 15..16;
pub const PUB_RANGE: Range<usize> = 201..233;
pub const SIG_RANGE: Range<usize> = 368..432;
pub const SIGNDATA_RANGE: Range<usize> = 4..358;
pub const FWID_RANGE: Range<usize> = 326..358;
pub const CERT_TMPL: [u8; 432] = [
    0x30, 0x82, 0x01, 0xac, 0x30, 0x82, 0x01, 0x5e, 0xa0, 0x03, 0x02, 0x01,
    0x02, 0x02, 0x01, 0x00, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x30,
    0x42, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
    0x55, 0x53, 0x31, 0x1f, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c,
    0x16, 0x4f, 0x78, 0x69, 0x64, 0x65, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x75,
    0x74, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x31,
    0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x09, 0x64, 0x65,
    0x76, 0x69, 0x63, 0x65, 0x2d, 0x69, 0x64, 0x30, 0x20, 0x17, 0x0d, 0x32,
    0x33, 0x30, 0x35, 0x30, 0x32, 0x31, 0x39, 0x34, 0x39, 0x31, 0x31, 0x5a,
    0x18, 0x0f, 0x39, 0x39, 0x39, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33,
    0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, 0x06,
    0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x1f, 0x30, 0x1d,
    0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x16, 0x4f, 0x78, 0x69, 0x64, 0x65,
    0x20, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x72, 0x20, 0x43, 0x6f,
    0x6d, 0x70, 0x61, 0x6e, 0x79, 0x31, 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55,
    0x04, 0x03, 0x0c, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x30, 0x2a, 0x30,
    0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x03, 0x21, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0xa3, 0x7b, 0x30, 0x79, 0x30, 0x0c, 0x06,
    0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30,
    0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03,
    0x02, 0x07, 0x80, 0x30, 0x17, 0x06, 0x03, 0x55, 0x1d, 0x20, 0x01, 0x01,
    0xff, 0x04, 0x0d, 0x30, 0x0b, 0x30, 0x09, 0x06, 0x07, 0x67, 0x81, 0x05,
    0x05, 0x04, 0x64, 0x08, 0x30, 0x40, 0x06, 0x06, 0x67, 0x81, 0x05, 0x05,
    0x04, 0x01, 0x01, 0x01, 0xff, 0x04, 0x33, 0x30, 0x31, 0xa6, 0x2f, 0x30,
    0x2d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x08,
    0x04, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x05,
    0x06, 0x03, 0x2b, 0x65, 0x70, 0x03, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
];
